package com.alex.dao;

import com.alex.pojo.User;
import com.alex.pojo.UserA;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    // 如果在mybatis-config.xml中定义了mapper的class声明,则此类注解有效,等同于mapper.xml中的配置

    // insert user
    int addUser(User user);

    // delete user
    int deleteUser(int Id);

    // update user
    int updateUser(User user);

    // query user with id
//    @Select("select * from user where id=#{id}")
    User getUser(int id);

    // query user with id
//    @Select("select * from user where id=#{id}")
    UserA getUserA(int id);

    // query users
//    @Select("select * from mybatis.user")
    List<User> getUserList();

    List<User> getUserListLimit(int limit);



    // insert user with map
    int addUserWithMap(Map<String, Object> map);

    // update user with map
    int updateUserWithMap(Map<String, Object> map);

    // query like
    List<User> getUserLike(String value);
//    List<User> getUserLike(@Param("v")String value);





    // insert users
    int addUsers(List<User> users);
}
